import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: () => import('../views/login.vue'),
    redirect:'/login',
  },
  {
    path: '/login',
    component: () => import('../views/login.vue'),
  },
  {
    path: '/home',
    component: Home,
    redirect:'/index',
    children:[
      { path: '/index',component: () => import(/* webpackChunkName: "about" */ '../views/Index.vue')},
      { path: '/message',component:  () => import(/* webpackChunkName: "about" */ '../views/Message.vue')},
      { path: '/health',component:  () => import(/* webpackChunkName: "about" */ '../views/health.vue')},
      { path: '/askforleave',component:  () => import(/* webpackChunkName: "about" */ '../views/askforleave.vue')},
    ]
  },
  {
    path: '/teacherhome',
    component: () => import('../views/teacherHome.vue'),
    redirect:'/teacherindex',
    children:[
      { path: '/teacherindex',component: () => import(/* webpackChunkName: "about" */ '../views/teacherIndex.vue')},
      { path: '/teachermessage',component:  () => import(/* webpackChunkName: "about" */ '../views/teacherMessage.vue')},
      { path: '/teacherhealth',component:  () => import(/* webpackChunkName: "about" */ '../views/teacherhealth.vue')},
      { path: '/teacheraskforleave',component:  () => import(/* webpackChunkName: "about" */ '../views/teacheraskforleave.vue')},
    ]
  },
  {
    path: '/adminhome',
    component:  () => import('../views/adminHome.vue'),
    redirect:'/adminindex',
    children:[
      { path: '/adminindex',component: () => import(/* webpackChunkName: "about" */ '../views/adminindex.vue')},
      { path: '/adminmessage',component:  () => import(/* webpackChunkName: "about" */ '../views/adminmessage.vue')},
      { path: '/adminpeople',component:  () => import(/* webpackChunkName: "about" */ '../views/adminpeople.vue')},
    ]
  },

]

const router = new VueRouter({
  routes
})

export default router
